-
Notifications
You must be signed in to change notification settings - Fork 0
Hw5 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: hw4
Are you sure you want to change the base?
Hw5 #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошая работа! Есть мелочи, которые не добиты в самых сложных функциях, постаралась расписать логику, как это можно исправить и в чём конкретно возникли ошибки. Но в целом здорово, проделана отличная работа.
По мелочи по оформлению: уж очень минималистичный ридми, не везде хватает аннотаций типов, докстринги не все соответствуют функциям.
Распределение баллов:
Добработка FASTQ-модуля : 15 баллов + 5 доп баллов за реализацию фильтрации.
Часть B: за каждую из двух функций (из трех предложенных)
convert_multiline_fasta_to_oneline: 35 баллов
parse_blast_output: 30 баллов
Результат в итоге не корректный, но очень разумное направление мысли и реализации.
Третья функция была не обязательна, но она также большей частью реализована - 7 доп баллов.
Обновление ридми: 8 баллов (уж очень минималистично, без версий, и упоминание функций для fastq пропало).
Общее: -5б за чтение всего файла разом.
Итоговые баллы за задание: 83 + 12 дополнительно.
| if output_fasta is None: | ||
| output_fasta = "converted_" + input_fasta.split("/")[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, хороший способ справиться. Единственное что на свой вкус я бы подписала как "oneline" или еще с каким-то более явным указанием на то, что конвертед то.
| output_fasta (str, optional): path for the converted file. | ||
|
|
||
| Returns: | ||
| str: path to the converted FASTA file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Неправда, не возвращает такое.
| results = [] | ||
|
|
||
| with open(input_file, "r") as f: | ||
| lines = f.readlines() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для файлов BLAST это может быть большим объемом, не стоить загружать их целиком в память.
| None | ||
| """ | ||
|
|
||
| results = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Список вместо множества. Возможны дубликаты при нескольких QUERY с одинаковым топ-хитом.
| if i + 1 < len(lines): | ||
| next_line = lines[i + 1].strip() | ||
| if next_line: | ||
| results.append(next_line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В задании нужен только Description, а тут добавится полная строка, в которой есть и другие вещи (даже если исправить комментарий выше).
| if line.startswith("/gene="): | ||
| gene = line.split('"')[1] | ||
| elif line.startswith("/translation="): | ||
| translation = line.split('"')[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А в таком формате потеряется всегда, потому что в строке просто не будет закрывающей кавычки.
| translation = "" | ||
|
|
||
| for line in all_lines: | ||
| line = line.rstrip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rstrip это rights strip, он не удалит отступы слева и строка никогда не будет начинаться с того, что ищется дальше.
| mode = "w" if overwrite else "a" | ||
|
|
||
| return filtered | ||
| with open(output_fastq, mode) as out: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Она принимает из главной фунции сиквенсы на запись и output_fastq, и сохраняет отфильтрованные данные в папку filtered (ее может и не быть) по имени output_fastq.
Не реализована часть задания. Совсем для красоты было бы еще проверить, output_fastq уже .fastq или нет, но это так.
| seq = f.readline().rstrip() | ||
| f.readline() # plus line | ||
| qual = f.readline().rstrip() | ||
| yield name[1:], seq, qual # remove '@' from name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 лайк что тут не чтение всего сразу, хорошая реализация.
|
|
||
| # BioToolkit | ||
|
|
||
| This is a small bioinformatics toolkit for working with DNA and RNA sequences be dadaist2001. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This is a small bioinformatics toolkit for working with DNA and RNA sequences be dadaist2001. | |
| This is a small bioinformatics toolkit for working with DNA and RNA sequences by dadaist2001. | |
Added FASTQ reading and file processing functions